home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Power 1997 December
/
MACPOWER-1997-12.ISO.7z
/
MACPOWER-1997-12.ISO
/
AMUG
/
PROGRAMMING
/
Raven 1.2.sit
/
Raven 1.2
/
Source
/
Foundation
/
OS
/
ZBaseTimer.h
< prev
next >
Wrap
Text File
|
1997-08-02
|
1KB
|
64 lines
/*
* File: ZBaseTimer.h
* Summary: Abstract base class for a mixin that gets periodic time.
* Written by: Jesse Jones
*
* Copyright ゥ 1996 Jesse Jones.
* For conditions of distribution and use, see copyright notice in ZTypes.h
*
* Change History (most recent first):
*
* <-> 6/23/96 JDJ Created
*/
#pragma once
#include <ZTypes.h>
// ===================================================================================
// class MBaseTimer
// ===================================================================================
class MBaseTimer {
//-----------------------------------
// Initialization/Destruction
//
public:
virtual ~MBaseTimer();
explicit MBaseTimer(MilliSecond freq, bool running = false);
// Frequency is the interval at which the timer wants to be called.
private:
MBaseTimer(const MBaseTimer& rhs);
MBaseTimer& operator=(const MBaseTimer& rhs);
//-----------------------------------
// New API
//
public:
bool TimerIsRunning() const {return mTimerIsRunning;}
virtual void StartTimer();
virtual void StopTimer();
MilliSecond GetTimerFreq() const {return mTimerFreq;}
virtual void SetTimerFreq(MilliSecond freq);
protected:
virtual void OnTime() = 0;
//-----------------------------------
// Data members
//
protected:
bool mTimerIsRunning;
MilliSecond mTimerFreq;
};